package com.ng.finance.api.vo;

import lombok.Data;

import java.io.Serializable;
import java.util.Map;

@Data
public class FinanceIndexListVo implements Serializable {

    public Map<String, Object> userPays;
    public String yesterdayPay = "0.00";//昨日消费
    public String payTotal = "0.00";//总消费
    public String payMonth = "0.00";//本月消費
    public String queryDate;//查询日期
    public String payToday = "0.00";//今日消费

    public FinanceIndexListVo(Double payMonth, String queryDate, Map<String, Object> userPays) {
        this.payMonth = payMonth != null ? String.format("%.2f", payMonth) : "0.00";
        this.queryDate = queryDate;
        userPays.remove("payMonth");
        this.userPays = userPays;
    }

    public FinanceIndexListVo(Double yesterdayPay, Double payTotal) {
        this.yesterdayPay = yesterdayPay != null ? String.format("%.2f", yesterdayPay) : "0.00";
        this.payTotal = payTotal != null ? String.format("%.2f", payTotal) : "0.00";

    }

    public FinanceIndexListVo(Double yesterdayPay, Double payTotal, Double payToday) {
        this.yesterdayPay = yesterdayPay != null ? String.format("%.2f", yesterdayPay) : "0.00";
        this.payTotal = payTotal != null ? String.format("%.2f", payTotal) : "0.00";
        this.payToday = payToday != null ? String.format("%.2f", payToday) : "0.00";

    }

    public FinanceIndexListVo() {
    }
}
